package com.bestdreamer.lock;

public class Demo2Run {

    public static void main(String[] args) throws InterruptedException {

        Demo2Service service = new Demo2Service();
        Demo2ThreadA threadA = new Demo2ThreadA(service);
        threadA.setName("A");
        threadA.start();
        Thread.sleep(1000);
        Demo2ThreadB threadB = new Demo2ThreadB(service);
        threadB.setName("B");
        threadB.start();
    }
}
